<% title "#{platform_name(@platform_name)} - Libraries.io" %>
<% description "A detailed listing of the most popular, recently updated and most watched #{platform_name(@platform_name)} packages online" %>
<% content_for :atom, auto_discovery_link_tag(:atom, search_url(platforms: @platform_name, sort: 'latest_release_published_at', order: 'desc', format: :atom), title: "Updated #{platform_name(@platform_name)} Packages") %>
<% content_for :atom, auto_discovery_link_tag(:atom, search_url(platforms: @platform_name, sort: 'created_at', order: 'desc', format: :atom), title: "New #{platform_name(@platform_name)} Packages") %>

<div class='row'>
  <div class='col-sm-6'>
    <h1>
      <div class="pictogram pictogram-lg pictogram-<%= @platform_name.downcase %>"></div>
      <%= platform_name(@platform_name) %>
    </h1>
  </div>
  <div class="col-sm-6">
    <br>
    <p>
      Website: <%= link_to @platform::URL, @platform::URL %>
    </p>
    <p>
      Total Packages: <%= number_with_delimiter Project.platform(@platform_name).not_removed.count %>
    </p>
  </div>
</div>
<hr>
<div class="row">
  <div class="col-md-8">
    <div class="row">
      <% if @popular.any? %>
        <div class='col-sm-6 platform-column'>
          <h4>
            Popular <%= platform_name(@platform_name) %> Packages
            <small class='more'>
              <%= link_to 'See more &raquo;'.html_safe, search_path(platforms: @platform_name, sort: 'rank', order: 'desc') %>
            </small>
          </h4>
          <%= render @popular %>
        </div>
      <% end %>

      <% if @created.any? %>
        <div class='col-sm-6 platform-column'>
          <h4>
            <%= link_to search_url(platforms: @platform_name, sort: 'created_at', order: 'desc', format: :atom), class: 'rss' do %>
              <%= fa_icon "rss-square" %>
            <% end %>
            New <%= platform_name(@platform_name) %> Packages
            <small class='more'>
              <%= link_to 'See more &raquo;'.html_safe, search_path(platforms: @platform_name, sort: 'created_at', order: 'desc') %>
            </small>
          </h4>
          <%= render @created %>
        </div>
      <% end %>

      <% if @updated.any? %>
      <div class='col-sm-6 platform-column'>
        <h4>
          <%= link_to search_url(platforms: @platform_name, sort: 'latest_release_published_at', order: 'desc', format: :atom), class: 'rss' do %>
            <%= fa_icon "rss-square" %>
          <% end %>
          Updated <%= platform_name(@platform_name) %> Packages
          <small class='more'>
            <%= link_to 'See more &raquo;'.html_safe, search_path(platforms: @platform_name, sort: 'latest_release_published_at', order: 'desc') %>
          </small>
        </h4>
        <%= render @updated %>
      </div>
      <% end %>

      <% if @dependend.any? %>
        <div class='col-sm-6 platform-column'>
          <h4>Most Depended upon <%= platform_name(@platform_name) %> Packages</h4>
          <%= render @dependend %>
        </div>
      <% end %>

    </div>
  </div>
  <div class="col-md-4">
    <div class='row'>
      <% if @languages.many? %>
        <div class='col-md-12 col-sm-4'>
          <h4>
            <%= fa_icon 'code' %>
            Top <%= platform_name(@platform_name) %> Languages
          </h4>
          <%= render partial: 'languages/list_language', collection: @languages, as: :language %>
        </div>
      <% end %>
      <% if @licenses.many? %>
        <div class='col-md-12 col-sm-4'>
          <h4>
            <%= fa_icon 'gavel' %>
            Top <%= platform_name(@platform_name) %> Licenses
          </h4>
          <%= render partial: 'licenses/list_license', collection: @licenses, as: :license %>
        </div>
      <% end %>
      <% if @keywords.many? %>
        <div class='col-md-12 col-sm-4'>
          <h4>
            <%= fa_icon 'tags' %>
            Top <%= platform_name(@platform_name) %> Keywords
          </h4>
          <%= render partial: 'keywords/list_keyword', collection: @keywords, as: :keyword %>
        </div>
      <% end %>
    </div>
  </div>
</div>
